home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / AppleGuide.p < prev    next >
Text File  |  1996-05-01  |  9KB  |  355 lines

  1. {
  2.      File:        AppleGuide.p
  3.  
  4.      Contains:    Apple Guide Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT AppleGuide;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __APPLEGUIDE__}
  28. {$SETC __APPLEGUIDE__ := 1}
  29.  
  30. {$I+}
  31. {$SETC AppleGuideIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __APPLEEVENTS__}
  35. {$I AppleEvents.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __FILES__}
  38. {$I Files.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __TYPES__}
  41. {$I Types.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  49. {  Types }
  50.  
  51. TYPE
  52.     AGRefNum                            = UInt32;
  53.     AGCoachRefNum                        = UInt32;
  54.     AGContextRefNum                        = UInt32;
  55.     AGAppInfoPtr = ^AGAppInfo;
  56.     AGAppInfo = RECORD
  57.         eventId:                AEEventID;
  58.         refCon:                    LONGINT;
  59.         contextObj:                Ptr;                                    {  private system field }
  60.     END;
  61.  
  62.     AGAppInfoHdl                        = ^AGAppInfoPtr;
  63.     CoachReplyProcPtr = ProcPtr;  { FUNCTION CoachReply(VAR pRect: Rect; name: Ptr; refCon: LONGINT): OSErr; }
  64.  
  65.     ContextReplyProcPtr = ProcPtr;  { FUNCTION ContextReply(pInputData: Ptr; inputDataSize: Size; VAR ppOutputData: Ptr; VAR pOutputDataSize: Size; hAppInfo: AGAppInfoHdl): OSErr; }
  66.  
  67.     CoachReplyUPP = UniversalProcPtr;
  68.     ContextReplyUPP = UniversalProcPtr;
  69.  
  70. CONST
  71.     uppCoachReplyProcInfo = $00000FE0;
  72.     uppContextReplyProcInfo = $0000FFE0;
  73.  
  74. FUNCTION NewCoachReplyProc(userRoutine: CoachReplyProcPtr): CoachReplyUPP;
  75.     {$IFC NOT GENERATINGCFM }
  76.     INLINE $2E9F;
  77.     {$ENDC}
  78.  
  79. FUNCTION NewContextReplyProc(userRoutine: ContextReplyProcPtr): ContextReplyUPP;
  80.     {$IFC NOT GENERATINGCFM }
  81.     INLINE $2E9F;
  82.     {$ENDC}
  83.  
  84. FUNCTION CallCoachReplyProc(VAR pRect: Rect; name: Ptr; refCon: LONGINT; userRoutine: CoachReplyUPP): OSErr;
  85.     {$IFC NOT GENERATINGCFM}
  86.     INLINE $205F, $4E90;
  87.     {$ENDC}
  88.  
  89. FUNCTION CallContextReplyProc(pInputData: Ptr; inputDataSize: Size; VAR ppOutputData: Ptr; VAR pOutputDataSize: Size; hAppInfo: AGAppInfoHdl; userRoutine: ContextReplyUPP): OSErr;
  90.     {$IFC NOT GENERATINGCFM}
  91.     INLINE $205F, $4E90;
  92.     {$ENDC}
  93. {  Constants }
  94.  
  95. CONST
  96.     kAGDefault                    = 0;
  97.     kAGFrontDatabase            = 1;
  98.     kAGNoMixin                    = -1;
  99.  
  100.     kAGViewFullHowdy            = 1;                            {  Full-size Howdy }
  101.     kAGViewTopicAreas            = 2;                            {  Full-size Topic Areas }
  102.     kAGViewIndex                = 3;                            {  Full-size Index Terms }
  103.     kAGViewLookFor                = 4;                            {  Full-size Look-For (Search) }
  104.     kAGViewSingleHowdy            = 5;                            {  Single-list-size Howdy }
  105.     kAGViewSingleTopics            = 6;                            {  Single-list-size Topics }
  106.  
  107.     kAGFileMain                    = 'poco';
  108.     kAGFileMixin                = 'mixn';
  109.  
  110. {  To test against AGGetAvailableDBTypes }
  111.     kAGDBTypeBitAny                = $00000001;
  112.     kAGDBTypeBitHelp            = $00000002;
  113.     kAGDBTypeBitTutorial        = $00000004;
  114.     kAGDBTypeBitShortcuts        = $00000008;
  115.     kAGDBTypeBitAbout            = $00000010;
  116.     kAGDBTypeBitOther            = $00000080;
  117.  
  118.  
  119. TYPE
  120.     AGStatus                            = UInt16;
  121. {  Returned by AGGetStatus }
  122.  
  123. CONST
  124.     kAGIsNotRunning                = 0;
  125.     kAGIsSleeping                = 1;
  126.     kAGIsActive                    = 2;
  127.  
  128.  
  129. TYPE
  130.     AGWindowKind                        = UInt16;
  131. {  Returned by AGGetFrontWindowKind }
  132.  
  133. CONST
  134.     kAGNoWindow                    = 0;
  135.     kAGAccessWindow                = 1;
  136.     kAGPresentationWindow        = 2;
  137.  
  138. {
  139.  Error Codes
  140.  Not an enum, because other OSErrs are valid.
  141. }
  142.  
  143. TYPE
  144.     AGErr                                = SInt16;
  145. {  Apple Guide error codes }
  146.  
  147. CONST
  148.                                                                 {  -------------------- Apple event reply codes }
  149.     kAGErrUnknownEvent            = -2900;
  150.     kAGErrCantStartup            = -2901;
  151.     kAGErrNoAccWin                = -2902;
  152.     kAGErrNoPreWin                = -2903;
  153.     kAGErrNoSequence            = -2904;
  154.     kAGErrNotOopsSequence        = -2905;
  155.     kAGErrReserved06            = -2906;
  156.     kAGErrNoPanel                = -2907;
  157.     kAGErrContentNotFound        = -2908;
  158.     kAGErrMissingString            = -2909;
  159.     kAGErrInfoNotAvail            = -2910;
  160.     kAGErrEventNotAvailable        = -2911;
  161.     kAGErrCannotMakeCoach        = -2912;
  162.     kAGErrSessionIDsNotMatch    = -2913;
  163.     kAGErrMissingDatabaseSpec    = -2914;                        {  -------------------- Coach's Chalkboard reply codes }
  164.     kAGErrItemNotFound            = -2925;
  165.     kAGErrBalloonResourceNotFound = -2926;
  166.     kAGErrChalkResourceNotFound    = -2927;
  167.     kAGErrChdvResourceNotFound    = -2928;
  168.     kAGErrAlreadyShowing        = -2929;
  169.     kAGErrBalloonResourceSkip    = -2930;
  170.     kAGErrItemNotVisible        = -2931;
  171.     kAGErrReserved32            = -2932;
  172.     kAGErrNotFrontProcess        = -2933;
  173.     kAGErrMacroResourceNotFound    = -2934;                        {  -------------------- API reply codes }
  174.     kAGErrAppleGuideNotAvailable = -2951;
  175.     kAGErrCannotInitCoach        = -2952;
  176.     kAGErrCannotInitContext        = -2953;
  177.     kAGErrCannotOpenAliasFile    = -2954;
  178.     kAGErrNoAliasResource        = -2955;
  179.     kAGErrDatabaseNotAvailable    = -2956;
  180.     kAGErrDatabaseNotOpen        = -2957;
  181.     kAGErrMissingAppInfoHdl        = -2958;
  182.     kAGErrMissingContextObject    = -2959;
  183.     kAGErrInvalidRefNum            = -2960;
  184.     kAGErrDatabaseOpen            = -2961;
  185.     kAGErrInsufficientMemory    = -2962;
  186.  
  187. {
  188.  Events
  189.  Not an enum because we want to make assignments.
  190. }
  191.  
  192. TYPE
  193.     AGEvent                                = UInt32;
  194. {  Handy events for AGGeneral. }
  195.  
  196. CONST
  197.                                                                 {  Panel actions (Require a presentation window). }
  198.     kAGEventDoCoach                = 'doco';
  199.     kAGEventDoHuh                = 'dhuh';
  200.     kAGEventGoNext                = 'gonp';
  201.     kAGEventGoPrev                = 'gopp';
  202.     kAGEventHidePanel            = 'pahi';
  203.     kAGEventReturnBack            = 'gobk';
  204.     kAGEventShowPanel            = 'pash';
  205.     kAGEventTogglePanel            = 'patg';
  206.  
  207. {
  208.  Functions
  209.  AGClose
  210.  Close the database associated with the AGRefNum.
  211. }
  212. FUNCTION AGClose(VAR refNum: AGRefNum): AGErr;
  213.     {$IFC NOT GENERATINGCFM}
  214.     INLINE $7011, $AA6E;
  215.     {$ENDC}
  216. {
  217.  AGGeneral
  218.  Cause various events to happen.
  219. }
  220. FUNCTION AGGeneral(refNum: AGRefNum; theEvent: AGEvent): AGErr;
  221.     {$IFC NOT GENERATINGCFM}
  222.     INLINE $700D, $AA6E;
  223.     {$ENDC}
  224. {
  225.  AGGetAvailableDBTypes
  226.  Return the database types available for this application.
  227. }
  228. FUNCTION AGGetAvailableDBTypes: UInt32;
  229.     {$IFC NOT GENERATINGCFM}
  230.     INLINE $7008, $AA6E;
  231.     {$ENDC}
  232. {
  233.  AGGetFrontWindowKind
  234.  Return the kind of the front window.
  235. }
  236. FUNCTION AGGetFrontWindowKind(refNum: AGRefNum): AGWindowKind;
  237.     {$IFC NOT GENERATINGCFM}
  238.     INLINE $700C, $AA6E;
  239.     {$ENDC}
  240. {
  241.  AGGetFSSpec
  242.  Return the FSSpec for the AGRefNum.
  243. }
  244. FUNCTION AGGetFSSpec(refNum: AGRefNum; VAR fileSpec: FSSpec): AGErr;
  245.     {$IFC NOT GENERATINGCFM}
  246.     INLINE $700F, $AA6E;
  247.     {$ENDC}
  248. {
  249.  AGGetStatus
  250.  Return the status of Apple Guide.
  251. }
  252. FUNCTION AGGetStatus: AGStatus;
  253.     {$IFC NOT GENERATINGCFM}
  254.     INLINE $7009, $AA6E;
  255.     {$ENDC}
  256. {
  257.  AGInstallCoachHandler
  258.  Install a Coach object location query handler.
  259. }
  260. FUNCTION AGInstallCoachHandler(coachReplyProc: CoachReplyUPP; refCon: LONGINT; VAR resultRefNum: AGCoachRefNum): AGErr;
  261.     {$IFC NOT GENERATINGCFM}
  262.     INLINE $7012, $AA6E;
  263.     {$ENDC}
  264. {
  265.  AGInstallContextHandler
  266.  Install a context check query handler.
  267. }
  268. FUNCTION AGInstallContextHandler(contextReplyProc: ContextReplyUPP; eventID: AEEventID; refCon: LONGINT; VAR resultRefNum: AGContextRefNum): AGErr;
  269.     {$IFC NOT GENERATINGCFM}
  270.     INLINE $7013, $AA6E;
  271.     {$ENDC}
  272. {
  273.  AGIsDatabaseOpen
  274.  Return true if the database associated with the AGRefNum is open.
  275. }
  276. FUNCTION AGIsDatabaseOpen(refNum: AGRefNum): BOOLEAN;
  277.     {$IFC NOT GENERATINGCFM}
  278.     INLINE $7006, $AA6E;
  279.     {$ENDC}
  280. {
  281.  AGOpen
  282.  Open a guide database.
  283. }
  284. FUNCTION AGOpen(VAR fileSpec: FSSpec; flags: UInt32; mixinControl: Handle; VAR resultRefNum: AGRefNum): AGErr;
  285.     {$IFC NOT GENERATINGCFM}
  286.     INLINE $7001, $AA6E;
  287.     {$ENDC}
  288. {
  289.  AGOpenWithSearch
  290.  Open a guide database and preset a search string.
  291. }
  292. FUNCTION AGOpenWithSearch(VAR fileSpec: FSSpec; flags: UInt32; mixinControl: Handle; searchString: Str255; VAR resultRefNum: AGRefNum): AGErr;
  293.     {$IFC NOT GENERATINGCFM}
  294.     INLINE $7002, $AA6E;
  295.     {$ENDC}
  296. {
  297.  AGOpenWithSequence
  298.  Open a guide database and display a presentation window sequence.
  299. }
  300. FUNCTION AGOpenWithSequence(VAR fileSpec: FSSpec; flags: UInt32; mixinControl: Handle; sequenceID: INTEGER; VAR resultRefNum: AGRefNum): AGErr;
  301.     {$IFC NOT GENERATINGCFM}
  302.     INLINE $7004, $AA6E;
  303.     {$ENDC}
  304. {
  305.  AGOpenWithView
  306.  Open a guide database and override the default view.
  307. }
  308. FUNCTION AGOpenWithView(VAR fileSpec: FSSpec; flags: UInt32; mixinControl: Handle; viewNum: INTEGER; VAR resultRefNum: AGRefNum): AGErr;
  309.     {$IFC NOT GENERATINGCFM}
  310.     INLINE $7005, $AA6E;
  311.     {$ENDC}
  312. {
  313.  AGQuit
  314.  Make Apple Guide quit.
  315. }
  316. FUNCTION AGQuit: AGErr;
  317.     {$IFC NOT GENERATINGCFM}
  318.     INLINE $7010, $AA6E;
  319.     {$ENDC}
  320. {
  321.  AGRemoveCoachHandler
  322.  Remove the Coach object location query handler.
  323. }
  324. FUNCTION AGRemoveCoachHandler(VAR resultRefNum: AGCoachRefNum): AGErr;
  325.     {$IFC NOT GENERATINGCFM}
  326.     INLINE $7014, $AA6E;
  327.     {$ENDC}
  328. {
  329.  AGRemoveContextHandler
  330.  Remove the context check query handler.
  331. }
  332. FUNCTION AGRemoveContextHandler(VAR resultRefNum: AGContextRefNum): AGErr;
  333.     {$IFC NOT GENERATINGCFM}
  334.     INLINE $7015, $AA6E;
  335.     {$ENDC}
  336. {
  337.  AGStart
  338.  Start up Apple Guide in the background.
  339. }
  340. FUNCTION AGStart: AGErr;
  341.     {$IFC NOT GENERATINGCFM}
  342.     INLINE $700A, $AA6E;
  343.     {$ENDC}
  344. {$ENDC}
  345. {$ALIGN RESET}
  346. {$POP}
  347.  
  348. {$SETC UsingIncludes := AppleGuideIncludes}
  349.  
  350. {$ENDC} {__APPLEGUIDE__}
  351.  
  352. {$IFC NOT UsingIncludes}
  353.  END.
  354. {$ENDC}
  355.